
const initialState = {
   
    userData:{},
    isLogin:false
    
  }
  export default (state = initialState, action) => {
    switch (action.type) {
      case "PWDLOGIN_REQUEST":
        return Object.assign({}, state,{userData:{}})
      case "PWDLOGIN_SUCCESS":
       localStorage.setItem("userData",JSON.stringify(action.response.data)) 
       localStorage.setItem("isLogin",true) 
        return Object.assign({}, state,{userData:action.response.data,isLogin:true})
        case "PWDLOGIN_FAIL":
        localStorage.setItem("userData","{}") 
        localStorage.setItem("isLogin",false) 
        return Object.assign({}, state,{userData:{},isLogin:false})
        case "PWDLOGIN_LOGIN":
        return Object.assign({}, state,{isLogin:action.isLogin})
      default:
        return state
    }
  }